export const schema = {
    type: "page",
    title: "星级设置",
    body: [
        {
            visibleOn: '!data.org_id && !acl.can("skip:select-org")',
            type: 'tpl',
            tpl: `<div class="alert alert-warning">请先选择一个机构</div>`
        },

        {
            visibleOn: 'data.org_id || (acl.can("skip:select-org") && acl.can("star_team:list"))',
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                panelClassName: 'no-border m-b-none',
                api: "post:/api/starsetting",
                initApi: "get:/api/starsetting?org_id=${org_id}",
                // redirect: "/org/list",
                submitText: "",
                name: "theform",
                type: "form",
                title: "",
                actions: [
                    {
                        type: "submit",
                        primary: true,
                        label: "保存",
                        icon: "fa fa-save pull-left"
                    }
                ],
                collapsable: true,
                fieldSet: [
                    {
                        title: '是否星级认证',
                        subTitle: '只有开启了星级认证才能使用团队和志愿者星级认证相关功能',
                        collapsed: false,
                        bodyClassName: 'wrapper',
                        visiableOn: '',
                        controls: [
                            {
                                type: 'checkbox',
                                name: 'open_stars',
                                option: "是否开启团队星级认证",
                                trueValue: 1,
                                falseValue: 0
                            },
                        ],
                    },
                    {
                        title: '团队星级认证设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        visiableOn: '',
                        controls: [
                            {
                                type: 'text',
                                name: 't1',
                                validations: 'isNumeric',
                                label: '1星所需志愿时长',
                                required: true,
                            },
                            {
                                type: 'text',
                                name: 't2',
                                validations: 'isNumeric',
                                required: true,
                                label: '2星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 't3',
                                validations: 'isNumeric',
                                required: true,
                                label: '3星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 't4',
                                validations: 'isNumeric',
                                required: true,
                                label: '4星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 't5',
                                validations: 'isNumeric',
                                required: true,
                                label: '5星所需志愿时长'
                            },
                        ]
                    },
                    {
                        title: '志愿者星级认证设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: 'text',
                                name: 'v1',
                                validations: 'isNumeric',
                                required: true,
                                label: '1星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 'v2',
                                validations: 'isNumeric',
                                required: true,
                                label: '2星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 'v3',
                                validations: 'isNumeric',
                                required: true,
                                label: '3星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 'v4',
                                validations: 'isNumeric',
                                required: true,
                                label: '4星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 'v5',
                                validations: 'isNumeric',
                                required: true,
                                label: '5星所需志愿时长'
                            },
                        ]
                    },
                ]
            }
        }
    ]
};
